package com.za.upgradeshield;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.io.Serializable;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Response implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 成功标识true or false
     */
    private Boolean success;
    /**
     * 响应code
     */
    private Integer code;
    /**
     * 信息
     */
    private String msg;

    public static Response fail(Integer code, String msg) {
        Response result = new Response();
        result.setSuccess(Boolean.FALSE);
        result.setMsg(msg);
        result.setCode(code);
        return result;
    }

}
